import APIConstants from "../constants/APIConstants"

class UserModel{
    //封装接口1：用户注册

    //封装接口2：用户登录
    async login(phone,pwd){
        let url=APIConstants.LOGIN
        let res =await fetch(url,{
            method:"post",
            headers:{"Content-Type":"application/json"},    //设置请求头部
            body:JSON.stringify({phone,pwd})
        })
        return await res.json()
    }
    //封装接口3：获取当前登录用户的个人档案

    //封装接口4：查看所有用户的列表
}

let userModel =new UserModel()
export default userModel